<include file="Public:header" />
<div id="zoneHeader">
    <h2>站长报表</h2>
</div><!--/#zoneHeader-->
<div id="zoneBody">
    <div id="zoneBodySearch">
        <form id="formSearch" action="?m={$Think.const.MODULE_NAME}">
            <input type="hidden" name="sort" />
            <input type="hidden" name="sortdir" />

            <ul>
                <li><b>日期：</b><input type="text" name="day" class="fW100p" /></li>
                <li><b>站长编号：</b><input type="text" name="uid" class="fW80p" /></li>
                <li hide="3"><b>所属客服：</b> <select name="service_id"> <option value="">请选择</option> <volist name=":getAllSiterServiceList()" id="vo"> <option value="{$vo['uid']}">{$vo['contact']}</option> </volist> </select> </li>
                <li><button type="button" id="as" class="btnSearch">查询</button></li>
                <li><button type="button" class="btnResetForm">清空表单</button></li>
            </ul>
        </form>
    </div><!--/#zoneBodySearch-->
<style>
td span { display:block; color:#777; }
</style>
    <div id="zoneBodyContent">
        <table class="table2">
            <thead>
                <tr>
                    <th class="tAr">序号</th>
                    <th>日期</th>
                    <th class="tAr">站长编号</th>
                    <th class="tAl" hide="3"><a href="javascript:;" sort="service_id">所属客服</a></th>
                    <th class="tAr"><a href="javascript:;" sort="view">浏览量</a></th>
                    <th class="tAr"><a href="javascript:;" sort="num">结算数</a></th>
                    <th class="tAr" hide="3"><a href="javascript:;" sort="deduction">扣点</a></th>
                    <th class="tAr" hide="3"><a href="javascript:;" sort="click">点/弹</a></th>
                    <th class="tAr">CTR</th>
                    <th class="tAr"><a href="javascript:;" sort="r_searcher">搜</a></th>
                    <th class="tAr"><a href="javascript:;" sort="r_self">站内</a></th>
                    <th class="tAr"><a href="javascript:;" sort="r_other">站外</a></th>
                    <th class="tAr"><a href="javascript:;" sort="r_none">无来路</a></th>
                    <th class="tAr"><a href="javascript:;" sort="device_1">P</a></th>
                    <th class="tAr"><a href="javascript:;" sort="device_2">A</a></th>
                    <th class="tAr"><a href="javascript:;" sort="device_3">I</a></th>
                    <th class="tAr"><a href="javascript:;" sort="device_4">W</a></th>
                    <th class="tAr" hide="3"><a href="javascript:;" sort="p_flash">Flash</a></th>
                    <th class="tAr" hide="3"><a href="javascript:;" sort="p_alexa">Alexa</a></th>
                    <th class="tAr" hide="3"><a href="javascript:;" sort="p_net">net</a></th>
                    <th class="tAr" title="新来的流量" hide="3"><a href="javascript:;" sort="new_user">新流量</a></th>
                    <th class="tAr"><a href="javascript:;" sort="siter_income">应付</a></th>
                    <th hide="3"></th>
                </tr>
            </thead>
            <tbody>
                <volist name="page.record" id="vo">
                <php>
                $total = $vo['num'] + $vo['deduction'];

                $rSearcherScale = getCtr($total, $vo['r_searcher']);
                $rSelfScale = getCtr($total, $vo['r_self']);
                $rOtherScale = getCtr($total, $vo['r_other']);
                $rNoneScale = getCtr($total, $vo['r_none']);
                $device1Scale = getCtr($total, $vo['device_1']);
                $device2Scale = getCtr($total, $vo['device_2']);
                $device3Scale = getCtr($total, $vo['device_3']);
                $device4Scale = getCtr($total, $vo['device_4']);
                $pFlashScale = getCtr($total, $vo['p_flash']);
                $pAlexaScale = getCtr($total, $vo['p_alexa']);
                $pNetScale = getCtr($total, $vo['p_net']);
                $newUserScale = getCtr($total, $vo['new_user']);
                </php>
                <tr class="tAr">
                    <td>{$i}</td>
                    <td class="tAl">{$vo.day}</td>
                    <td><a href="?m=Siter&uid={$vo.uid}" target="_blank">{$vo.uid}</a><br />{$vo.user_name}</td>
                    <td class="tAl" hide="3">{:getServiceNameByUid($vo['service_id'])}</td>
                    <td>{$vo.view}</td>
                    <td>
                        <a href="?m=ClickDetail&day={$vo.day}&uid={$vo.uid}" hide="3"> {$vo.num}</a>
                        <div hide="5"> {$vo.num}</div>
                    </td>
                    <td hide="3">{$vo.deduction}</td>
                    <td hide="3">{$vo.click}</td>
                    <td>{:getCtr($vo['view'], $vo['num'])}%</td>
                    <td>{$vo.r_searcher}<span>{$rSearcherScale}%</span></td>
                    <td>{$vo.r_self}<span>{$rSelfScale}%</span></td>
                    <td>{$vo.r_other}<span>{$rOtherScale}%</span></td>
                    <td>{$vo.r_none}<span>{$rNoneScale}%</span></td>
                    <td title="PC流量">{$vo.device_1}<span>{$device1Scale}%</span></td>
                    <td title="Android流量">{$vo.device_2}<span>{$device2Scale}%</span></td>
                    <td title="IOS流量">{$vo.device_3}<span>{$device3Scale}%</span></td>
                    <td title="Window Phone流量">{$vo.device_4}<span>{$device4Scale}%</span></td>
                    <td hide="3">{$vo.p_flash}<span>{$pFlashScale}%</span></td>
                    <td hide="3">{$vo.p_alexa}<span>{$pAlexaScale}%</span></td>
                    <td hide="3">{$vo.p_net}<span>{$pNetScale}%</span></td>
                    <td hide="3">{$vo.new_user}<br /><span>{$newUserScale}%</span></td>
                    <td>{$vo.siter_income}</td>
                    <td class="tAl" hide="3"><a href="?m=ZoneStats&day={$vo.day}&uid={$vo.uid}">详</a></td>
                </tr>
                </volist>
            </tbody>
        </table>
        <notempty name="last7DayStats">
        <hr style="margin:10px 0"/>
        <table class="table2">
            <thead>
                <tr>
                    <th class="tAr">序号</th>
                    <th>日期</th>
                    <th class="tAr">站长编号</th>
                    <th hide="3">所属客服</th>
                    <th class="tAr">浏览量</th>
                    <th class="tAr">结算数</th>
                    <th class="tAr" hide="3">扣点</th>
                    <th class="tAr" hide="3">点/弹</th>
                    <th class="tAr">CTR</th>
                    <th class="tAr">搜</th>
                    <th class="tAr">站内</th>
                    <th class="tAr">站外</th>
                    <th class="tAr">无来路</th>
                    <th class="tAr" title="PC流量"><a href="javascript:;" sort="device_1">P</a></th>
                    <th class="tAr" title="Android流量"><a href="javascript:;" sort="device_2">A</a></th>
                    <th class="tAr" title="IOS流量"><a href="javascript:;" sort="device_3">I</a></th>
                    <th class="tAr" title="Window Phone流量"><a href="javascript:;" sort="device_4">W</a></th>
                    <th class="tAr" hide="3">Flash</th>
                    <th class="tAr" hide="3">Alexa</th>
                    <th class="tAr" hide="3">net</th>
                    <th class="tAr" title="新来的流量" hide="3">新流量</th>
                    <th class="tAr">应付</th>
                    <th hide="3"></th>
                </tr>
            </thead>
            <tbody>
                <volist name="last7DayStats" id="vo">
                <php>
                $total = $vo['num'] + $vo['deduction'];

                $rSearcherScale = getCtr($total, $vo['r_searcher']);
                $rSelfScale = getCtr($total, $vo['r_self']);
                $rOtherScale = getCtr($total, $vo['r_other']);
                $rNoneScale = getCtr($total, $vo['r_none']);
                $device1Scale = getCtr($total, $vo['device_1']);
                $device2Scale = getCtr($total, $vo['device_2']);
                $device3Scale = getCtr($total, $vo['device_3']);
                $device4Scale = getCtr($total, $vo['device_4']);
                $pFlashScale = getCtr($total, $vo['p_flash']);
                $pAlexaScale = getCtr($total, $vo['p_alexa']);
                $pNetScale = getCtr($total, $vo['p_net']);
                $newUserScale = getCtr($total, $vo['new_user']);
                </php>
                <tr class="tAr">
                    <td class="tAr">{$i}</td>
                    <td class="tAl">{$vo.day}</td>
                    <td><a href="?m=Siter&uid={$vo.uid}" target="_blank">{$vo.uid}</a><br />{:getSiterName($vo['uid'])}</td>
                    <td class="tAl" hide="3">{:getServiceNameByUid($vo['service_id'])}</td>
                    <td>{$vo.view}</td>
                    <td>
                        <a href="?m=ClickDetail&day={$vo.day}&uid={$vo.uid}" hide="3">{$vo.num}</a>
                        <div hide="5">{$vo.num}</div>
                    </td>
                    <td hide="3">{$vo.deduction}</td>
                    <td hide="3">{$vo.click}</td>
                    <td>{:getCtr($vo['view'], $vo['num'])}%</td>
                    <td>{$vo.r_searcher}<span>{$rSearcherScale}%</span></td>
                    <td>{$vo.r_self}<span>{$rSelfScale}%</span></td>
                    <td>{$vo.r_other}<span>{$rOtherScale}%</span></td>
                    <td>{$vo.r_none}<span>{$rNoneScale}%</span></td>
                    <td title="PC流量">{$vo.device1}<span>{$device1Scale}%</span></td>
                    <td title="Android流量">{$vo.device2}<span>{$device2Scale}%</span></td>
                    <td title="IOS流量">{$vo.device3}<span>{$device3Scale}%</span></td>
                    <td title="Window Phone流量">{$vo.device4}<span>{$device4Scale}%</span></td>
                    <td hide="3">{$vo.p_flash}<span>{$pFlashScale}%</span></td>
                    <td hide="3">{$vo.p_alexa}<span>{$pAlexaScale}%</span></td>
                    <td hide="3">{$vo.p_net}<span>{$pNetScale}%</span></td>
                    <td hide="3">{$vo.new_user}<span>{$newUserScale}%</span></td>
                    <td>{$vo.siter_income}</td>
                    <td class="tAl" hide="3"><a href="?m=ZoneStats&day={$vo.day}&uid={$vo.uid}">详</a></td>
                </tr>
                </volist>
            </tbody>
        </table>
        </notempty>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->
<div id="zoneFooter">{$page|uiGetPage}</div><!--/#zoneFooter-->
<script type="text/javascript">
$(function(){
    $('#formSearch').find('input[name=day]').datebox();
})
</script>
<include file="Public:footer" />
